//
//  HTTPRequest.m
//  CarHome
//
//  Created by lanou3g on 15-4-25.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "HTTPRequest.h"

@implementation HTTPRequest

+ (void)requestWithURL:(NSString *)urlStr method:(NSString *)method result:(RequestResult)result {
    NSURL *url = [NSURL URLWithString:urlStr];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
    [request setHTTPMethod:method];
    [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) {
        result(data);
    }];
}

@end


